package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
import java.util.List;

/**
 * 采购实体类
 * @author Zchaolin
 * @version 1.0
 * @created 29-7月-2022 9:34:36
 */
@TableName("t_buyer")
public class BuyerBean {

	/**
	 * 编号
	 */
	@TableId(value = "pk_buyerId",type = IdType.AUTO)
	private Integer id;
	/**
	 * 采购员
	 */
	@TableField("b_user")
	private String buyer;
	/**
	 * 采购时间
	 */
	@TableField("b_date")
	private LocalDate date = LocalDate.now();
	/**
	 * 采购明细集合
	 */
	@TableField(exist = false)
	private List<BuyerInfoBean> buyerInfoList;
	/**
	 * 所属供应商id
	 */
	@TableField("fk_supplierId")
	private Integer supplierId;
	/**
	 * 所属供应商实体
	 */
	@TableField(exist = false)
	private SupplierBean supplierBean;

	public BuyerBean(){

	}

	public BuyerBean(String buyer, Integer supplierId) {
		this.buyer = buyer;
		this.supplierId = supplierId;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getBuyer() {
		return buyer;
	}

	public void setBuyer(String buyer) {
		this.buyer = buyer;
	}

	public LocalDate getDate() {
		return date;
	}

	public void setDate(LocalDate date) {
		this.date = date;
	}

	public List<BuyerInfoBean> getBuyerInfoList() {
		return buyerInfoList;
	}

	public void setBuyerInfoList(List<BuyerInfoBean> buyerInfoList) {
		this.buyerInfoList = buyerInfoList;
	}

	public Integer getSupplierId() {
		return supplierId;
	}

	public void setSupplierId(Integer supplierId) {
		this.supplierId = supplierId;
	}

	public SupplierBean getSupplierBean() {
		return supplierBean;
	}

	public void setSupplierBean(SupplierBean supplierBean) {
		this.supplierBean = supplierBean;
	}

	@Override
	public String toString() {
		return "BuyerBean{" +
				"id=" + id +
				", buyer='" + buyer + '\'' +
				", date=" + date +
				", buyerInfoList=" + buyerInfoList +
				", supplierId=" + supplierId +
				", supplierBean=" + supplierBean +
				'}'+"\n";
	}
}